package com.credithc.customers.base.ro;

import com.credithc.customers.base.codes.CustomerCodes;
import com.credithc.customers.base.exception.CustomerException;
import com.credithc.customers.base.utils.CustomerUtils;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

/**
 * @description: 客户注册入参表
 * @author: fby
 * @date: 2020/01/14 14:16
 * @param: null
 * @return:
 */
@Data
public class CustomerUnifyRegisterRo extends CustomerBaseRo {

    private String phone;

    private String password;

    private String smsCode;

    public static void checkBaseParam(CustomerUnifyRegisterRo ro) {
        CustomerUtils.checkPhone(ro.getPhone());
        /*if (StringUtils.isBlank(ro.getPassword())) {
            throw new CustomerException(CustomerCodes.PARAM_VALIDATE_ERROR, "密码不能为空");
        }*/
        if (StringUtils.isBlank(ro.getSmsCode())) {
            throw new CustomerException(CustomerCodes.PARAM_VALIDATE_ERROR, "验证码不能为空");
        }
    }
}
